#pragma once
#include "ckProcessor.h"
#include "ckRasterBand.h"

namespace ck
{
	namespace algorithm
	{
		namespace raster
		{
			class ZPROCESSOR_API SIMProcessor : public Processor
			{
			public:
				SIMProcessor();
				virtual ~SIMProcessor();

			public:
				virtual RESULTCODE	Execute();


			public:
				void	SetBand(data::RasterBand* pBand1, data::RasterBand* pBand2);
				double	GetValue();

			protected:
				double		CalculateCoVariance(data::RasterBand* pBand1, double mean1, data::RasterBand* pBand2, double mean2);
				double		CalculateCoVariance_Byte(data::RasterBand* pBand1, double mean1, data::RasterBand* pBand2, double mean2);
				double		CalculateCoVariance_UInt16(data::RasterBand* pBand1, double mean1, data::RasterBand* pBand2, double mean2);



			protected:
				data::RasterBand* m_pBand1;
				data::RasterBand* m_pBand2;

				double m_sim;
				double m_k1;
				double m_k2;
			};
		}
	}
}